package gw.com.android.ui.chart.manager;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.RelativeLayout;

/**
 * Created by spence on 17-5-3.
 */

public class InterceptView extends RelativeLayout {

  public boolean intercept=false;

  public InterceptView(Context context) {
    super(context);
  }

  public InterceptView(Context context, AttributeSet attrs) {
    super(context, attrs);
  }

  public InterceptView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
  }

  @Override public boolean onInterceptTouchEvent(MotionEvent ev) {
    if(intercept){
      return true;
    }else {
      return super.onInterceptTouchEvent(ev);
    }
  }

  public boolean isIntercept() {
    return intercept;
  }

  public void setIntercept(boolean intercept) {
    this.intercept = intercept;
  }
}
